<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>云游注册中心</title>
<link href="__PUBLIC__/User/css/login.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body{
	font-family: "微软雅黑";
	font-size: 14px;
	background: url(__PUBLIC__/User/image/111111.jpg) fixed  ;
}

.u_user{
	width: 25px;
	height: 25px;
	background: url(__PUBLIC__/User/image/login_ico.png);
	background-position:  -125px 0;
	position: absolute;
	margin: 12px 13px;
}
.us_uer{
	width: 25px;
	height: 25px;
	background-image: url(__PUBLIC__/User/image/login_ico.png);
	background-position: -125px -34px;
	position: absolute;
	margin: 12px 13px;
}
.info{
	width: 100px;
	height: 25px;
	background-position: -130px -34px;
	position: absolute;
	margin: 12px 28px;
}
.info2{
	width: 100px;
	height: 25px;
	background-position: -130px -34px;
	position: absolute;
	margin: 12px 297px;
}

</style>
<script type="text/javascript" src="__PUBLIC__/User/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
		function checkcode(code) {
			if (code == "") {
				return ;
			}
			var sp1 = document.getElementById('info1');
			$.post("{:U('User/index/code_match')}","code="+code,function(res){
				if (res == '手机被注册') {
						sp1.innerHTML = "<font color='red'><b>手机被注册</b></font>"; 
					 }else if(res == '邮箱被注册'){
					 	sp1.innerHTML = "<font color='red'><b>邮箱被注册</b></font>"; 
					 }else if(res == '可以注册'){
					 	sp1.innerHTML = "<font color='green'><b>可以注册</b></font>"; 
					 }else {
						sp1.innerHTML = "<font color='red'><b>输入格式错误</b></font>"; 
					 }
			},"text");
		}
		function checkpassword(pwd) {
			if (pwd == "") {
				return ;
			}
			var sp2 = document.getElementById('info2');
			$.post("{:U('User/index/pwd_match')}","pwd="+pwd,function(res){
				if (res == '0') {
					sp2.innerHTML = "<font color='red'><b>密码不符合规定</b></font>"; 
				}else if(res == '1') {
					sp2.innerHTML = "<font color='red'></font>"; 
				}
			},"text");
		}



		function register(){
			var co = $('#info1').text();
			var pw = $('#info2').text();
			if(co=='可以注册' && pw==''){
				form.action="{:U('User/Index/register_do')}";
				form.method='post';
				form.submit();
			}
		}

</script>

</head>
<body>
<div class="logo_box">
	<h3>南京云游欢迎您</h3>
	<form action=""  method="" id="form">
		<div class="input_outer">
			<span class="u_user"></span>
			<input name="nickname" class="text" onFocus=" if(this.value=='昵称') this.value=''" onBlur="if(this.value=='') this.value='昵称'" value="昵称" style="color: #FFFFFF !important" type="text">
		</div>
		<div class="input_outer">
			<span class="u_user"></span>
			<input name="code" id="code" class="text" onFocus=" if(this.value=='邮箱/手机号码') this.value=''" onBlur="if(this.value=='') this.value='邮箱/手机号码'" value="邮箱/手机号码" style="color: #FFFFFF !important" type="text" onchange="checkcode(this.value)">
			<span id="info1" class="info"></span>
		</div>
		<div class="input_outer">
			<span class="us_uer"></span>
			<label class="l-login login_password" style="color: rgb(255, 255, 255);display: block;">输入密码 6~16位</label>
			<input name="password" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;" onFocus="$('.login_password').hide()" onBlur="if(this.value=='') $('.login_password').show()" value="" type="password" onchange="checkpassword(this.value)">
			<span id="info2" class="info2"></span>
		</div>

		<div class="mb2"><button class="act-but submit" style="color: #FFFFFF" onclick="register()">注册</button></div>
	</form>
	<div class="sas">
		已经注册账号！&nbsp<a href="{:U('User/Index/login')}" style="color: red;">登录</a>
	</div>
</div>
</body>
</html>